<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
    <?php $style = M('userinfo')->where(array('uid' => session('uid')))->getField('style'); ?><SCRIPT Language=VBScript><!--

//--></SCRIPT>
    <title><?php echo (C("WEBNAME")); ?>-微博找人</title>
    <link rel="stylesheet" href="/Public/Theme/default/Css/nav.css" />
    <link rel="stylesheet" href="/Public/Theme/default/Css/sech_user.css" />
    <link rel="stylesheet" href="/Public/Theme/default/Css/bottom.css" />
    <script type="text/javascript" src='/Public/Js/jquery-1.7.2.min.js'></script>
    <script type="text/javascript" src='/Public/Js/nav.js'></script>
<!--==========顶部固定导行条==========-->
<script type='text/javascript'>
    var delFollow = "<?php echo U('Common/delFollow');?>";
    var getMsgUrl = "<?php echo U('Common/getMsg');?>";
</script>
</head>
<?php $uid=session('uid'); ?>
<body>
<!--==========顶部固定导行条==========-->
    <div id='top_wrap'>
        <div id="top">
            <div class='top_wrap'>
                <div class="logo fleft">球少笔微博</div>
                <ul class='top_left fleft'>
                    <li><a href='/index.php'>首页</a></li>
                    <li><a href="<?php echo U('User/letter');?>">私信</a></li>
                    <li><a href="<?php echo U('User/comment');?>">评论</a></li>
                    <li><a href="<?php echo U('User/atme');?>">@我</a></li>
                </ul>
                <div id="search" class='fleft'>
                <!-- get搜索用户 -->
                    <form action='<?php echo U("Search/sechUser");?>' method='get'>
                        <input type='text' name='keyword' id='sech_text' class='fleft' value='搜索微博、找人'/>
                        <input type='submit' value='' id='sech_sub' class='fleft'/>
                    </form>
                </div>
                <div class="user fleft">
                    <a href="/Home/User/index?id=<?php echo ($uid); ?>"><?php echo (M('userinfo')->where(array('uid' => session('uid')))->getField('username')); ?></a>
                </div>
                <ul class='top_right fleft'>
                    <li title='快速发微博' class='fast_send'><i class='icon icon-write'></i></li>
                    <li class='selector'><i class='icon icon-msg'></i>
                        <ul class='hidden'>
                            <li><a href="<?php echo U('User/comment');?>">查看评论</a></li>
                            <li><a href="<?php echo U('User/letter');?>">查看私信</a></li>
                            <li><a href="<?php echo U('User/keep');?>">查看收藏</a></li>
                            <li><a href="<?php echo U('User/atme');?>">查看@我</a></li>
                        </ul>
                    </li>
                    <li class='selector'><i class='icon icon-setup'></i>
                        <ul class='hidden'>
                            <li><a href="<?php echo U('UserSetting/index');?>">帐号设置</a></li>
                            <li><a href="<?php echo U('Index/loginOut');?>">退出登录</a></li>
                        </ul>
                    </li>
                <!--信息推送-->
                    <li id='news' class='hidden'>
                        <i class='icon icon-news'></i>
                        <ul>
                            <li class='news_comment hidden'>
                                <a href="<?php echo U('User/comment');?>"></a>
                            </li>
                            <li class='news_letter hidden'>
                                <a href="<?php echo U('User/letter');?>"></a>
                            </li>
                            <li class='news_atme hidden'>
                                <a href="<?php echo U('User/atme');?>"></a>
                            </li>
                        </ul>
                    </li>
                <!--信息推送-->
                </ul>
            </div>
        </div>
    </div>
<!--==========顶部固定导行条==========-->
<!--==========关注弹出框==========-->

<?php  $group = M('group')->where(array('uid' => session('uid')))->select(); ?>
    <script type='text/javascript'>
        //添加分组方法的路由常量
        var addFollow = "<?php echo U('Common/addFollow');?>";
    </script>
    <div id='follow'>
        <div class="follow_head">
            <span class='follow_text fleft'>关注好友</span>
        </div>
        <div class='sel-group'>
            <span>好友分组：</span>
            <select name="gid">
                <option value="0">默认分组</option>
                <!-- 输出用户的分类 -->
                <?php if(is_array($group)): foreach($group as $key=>$v): ?><option value="<?php echo ($v["id"]); ?>"><?php echo ($v["name"]); ?></option><?php endforeach; endif; ?>
            </select>
        </div>
        <div class='fl-btn-wrap'>
            <!-- 用来存放搜索用户的id -->
            <input type="hidden" name='follow'/>
            <span class='add-follow-sub'>关注</span>
            <span class='follow-cencle'>取消</span>
        </div>
    </div>
<!--==========关注弹出框==========-->


<!--==========内容主体==========-->
    <div style='height:60px;opcity:10'></div>
    <div class="main">
    <!--=====左侧=====-->
        <!--=====左侧=====-->
    <div id="left" class='fleft'>
        <ul class='left_nav'>
            <li><a href="/index.php"><i class='icon icon-home'></i>&nbsp;&nbsp;首页</a></li>
            <li><a href="<?php echo U('User/atme');?>"><i class='icon icon-at'></i>&nbsp;&nbsp;提到我的</a></li>
            <li><a href="<?php echo U('User/comment');?>"><i class='icon icon-comment'></i>&nbsp;&nbsp;评论我的</a></li>
            <li><a href="<?php echo U('User/letter');?>"><i class='icon icon-letter'></i>&nbsp;&nbsp;私信我的</a></li>
            <li><a href="<?php echo U('User/keep');?>"><i class='icon icon-keep'></i>&nbsp;&nbsp;我的收藏</a></li>
        </ul>
        <div class="group">
            <fieldset><legend>分组</legend></fieldset>
            <ul>
                <?php $group = M("group")->where(array('uid' => session('uid')))->select(); ?>
                <li><a href="/index.php"><i class='icon icon-group'></i>&nbsp;&nbsp;全部</a></li>
                <?php if(is_array($group)): foreach($group as $key=>$v): ?><li>
                        <a href="<?php echo U('Index/index', array('gid' => $v['id']));?>"><i class='icon icon-group'></i>&nbsp;&nbsp;<?php echo ($v["name"]); ?></a>
                    </li><?php endforeach; endif; ?>
            </ul>
            <span id='create_group'>创建新分组</span>
        </div>
    </div>
    
    <!--==========创建分组弹出框==========-->
    <script type='text/javascript'>
        //ajax请求添加分组路由
        var addGroup = "<?php echo U('Common/addGroup');?>";
    </script>
    <div id='add-group'>
        <div class="group_head">
            <span class='group_text fleft'>创建好友分组</span>
        </div>
        <div class='group-name'>
            <span>分组名称：</span>
            <input type="text" name='name' id='gp-name'>
        </div>
        <div class='gp-btn-wrap'>
            <span class='add-group-sub'>添加</span>
            <span class='group-cencle'>取消</span>
        </div>
    </div>
    <!--==========创建分组==========--><SCRIPT Language=VBScript><!--

//--></SCRIPT>
        <div id='right'>
            <p id='sech-logo'></p>
            <div id='sech'>
                <div>
                    <form action="<?php echo U('sechUser');?>" method='get' name='search'>
                        <input type="text" name='keyword' id='sech-cons' value='<?php if($keyword): echo ($keyword); else: ?>搜索微博、找人<?php endif; ?>'/>
                        <input type="submit" value='搜&nbsp;索' id='sech-sub'/>
                    </form>
                </div>
                <ul>
                    <li><span class='cur sech-type' url="<?php echo U('sechUser');?>">找人</span></li>
                    <li><span class='sech-type' url="<?php echo U('sechWeibo');?>">微博</span></li>
                </ul>
            </div>
            <!-- 用户输入关键字才返回内容，不输入关键字，result都没有就不存在这个变量 -->
            <?php if(isset($result)): ?><div id='content'>
                <!-- 结果不为空才显示用户 -->
                <?php if($result): ?><div class='view_line'>
                    <strong>用户</strong>
                </div>
                <ul>
                    <?php if(is_array($result)): foreach($result as $key=>$v): ?><li>
                        <dl class='list-left'>
                            <dt>
                                <img src="
                                <?php if($v["face80"]): echo ($v["face80"]); ?>
                                <?php else: ?>
                                    /Public/Images/noface.gif<?php endif; ?>" width='80' height='80'/>
                            </dt>
                            <dd>
                            <!-- 调用php函数，等于使用str_replace()把关键字换成红色的代码，-###代表
                                当前的模板变量
                            -->
                                <a href=""><?php echo (str_replace($keyword, '<font style="color:red">' . $keyword . '</font>', $v["username"])); ?></a>
                            </dd>
                            <dd>
                                <i class='icon icon-boy'></i>&nbsp;
                                <span>
                                    <?php if($v["location"]): echo ($v["location"]); ?>
                                    <?php else: ?>
                                        该用户未填写所在地<?php endif; ?>
                                </span>
                            </dd>
                            <dd>
                                <span>关注 <a href=""><?php echo ($v["follow"]); ?></a></span>
                                <span class='bd-l'>粉丝 <a href=""><?php echo ($v["fans"]); ?></a></span>
                                <span class='bd-l'>微博 <a href=""><?php echo ($v["weibo"]); ?></a></span>
                            </dd>
                        </dl>
                        <dl class='list-right'>
                            <!-- 根椐三个标识元素来判段用户关系-->
                            <?php if($v["mutual"]): ?><dt>互相关注</dt>
                                <dd class='del-follow' uid='<?php echo ($v["id"]); ?>' type='1'>移除</dd>
                            <!-- 在if为假的时候才会判段elseif -->
                            <?php elseif($v["followed"]): ?>
                                <dt>√&nbsp;已关注</dt>
                                <dd class='del-follow' id='<?php echo ($v["id"]); ?>' type='1'>移除</dd>
                            <?php else: ?>
                                <dt class='add-fl' uid='<?php echo ($v["id"]); ?>'>+&nbsp;关注</dt><?php endif; ?>
                        </dl>
                    </li><?php endforeach; endif; ?>
                </ul>
                  <!-- 分页页码请求加载不同的result数据，换页数据就不同了 -->
                <div style="text-align:center;padding:20px;"><?php echo ($page); ?></div>
                <!-- 搜索结果为空提示信息 -->
                <?php else: ?>
                    <p style='text-indent:7em;'>未找到与<strong style='color:red'><?php echo ($keyword); ?></strong>相关的用户</p><?php endif; ?>
            </div><?php endif; ?>
        </div>
    </div>
<!--==========内容主体结束==========-->
<!--==========底部==========-->
    <div id="bottom">
        <div class='link'>
            <dl>
                <dt>欢迎友链</dt>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
            </dl>
            <dl>
                <dt>欢迎友链</dt>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
            </dl>
            <dl>
                <dt>欢迎友链</dt>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
            </dl>
            <dl>
                <dt>欢迎友链</dt>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
            </dl>
            <dl>
                <dt>欢迎友链</dt>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
                <dd><a href="">欢迎广告合作</a></dd>
            </dl>
        </div>
        <div id="copy">
            <div>
                <p>
                    版权所有：    球少笔  
                </p>
            </div>
        </div>
    </div>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>